#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    char arr[14];
    gets(arr);
    int i = 0;
    int ret = 1;
    int sum = 0;
    while (ret <= 9)
    {

        if (arr[i] - '0' >= 0 && arr[i] - '0' <= 9)
        {
            sum += (arr[i] - '0') * ret;
            ret++;
        }
        i++;
    }
    if (sum % 11 == arr[12] - '0' || sum % 11 == 10 && arr[12] == 'X')
        printf("Right\n");
    else
    {
        for (int i = 0; i < 12; i++)
            printf("%c", arr[i]);
        if (sum % 11 == 10)
            printf("X");
        else
            printf("%c", (sum % 11) + '0');
    }
    return 0;
}